<?php
header('Content-Type:text/html;Charset=UTF-8');

session_start();

if(isset($_SESSION['userId'])){

}else {
	die('<h3>登录信息不完整</h3><a href="/index.php">返回重新登录</a>');
};

@$id = $_SESSION['userId'];

require 'lib/db.php';

@$users = dbSelect("select u.id as uid,login,password,roleId,r.name as rname,w.id as wid,w.name as wname,age,sex,contact,address,img from users as u join role as r on u.roleId=r.id join worker as w on u.id=w.id",array('id'=>$id));

?>

<!DOCTYPE html>
<html>
   <head>
      <title>CRM客户关系管理系统</title>
	  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" charset="UTF-8" >
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="bootstrap/css/bootstrap-submenu.css" rel="stylesheet">
      <link href="bootstrap/css/superfish.css" rel="stylesheet">
      <link href="bootstrap/css/superfish-vertical.css" rel="stylesheet">
      <script src="bootstrap/js/jquery-1.11.1.min.js"></script>
      <script src="bootstrap/js/bootstrap.min.js"></script>
      <script src="bootstrap/js/bootstrap-submenu.js"></script>
      <script src="bootstrap/js/superfish.js"></script>
      <!--[if lt IE 9]>
         <script src="js/html5shiv.js"></script>
         <script src="js/respond.min.js"></script>
      <![endif]-->
   </head>
  <script src="lib/menu.js"></script>
   <script src="lib/red.js"></script>
    <script src="lib/dialog.js"></script>
<script>
$(function(){
		$('.menus').menu();

		$.ajaxSetup({
			dataType:'JSON',
			error:function(){
				alert('服务器交互出错！');
				}
			});
		$('#logoutBtn').click(function(){
			confirmDialog('提示','确定退出？');
			$('#confirm').click(function(){
				});
			});
			
	});
</script>
<style>
	#confirm{color:red}
	.header{background:#681709}
	.modaltitle{color:white;font-size:20px}
	.navbar{background:#681709;}
	.marginal{height:10px;background:red}
	.title{font-size:30px;text-align:cneter;background:}
	#span{color:#e8e8e8;}
	#c{color:#ff8d1c;}
	#R{color:#ffff1e;}
	#M{color:#00ff00;}
	#logoutBtn{font-size:18px;color:red}
	.font{margin:0px;height:59px;text-align:center;width:270px;background:#681709}
	#user{border:solid 1px;width:240px;height:32px;text-align:left;background:black;color:white}
	#users{width:80px;float:left;border:solid 1px;background:black;color:white}
	#marginal{height:490px;width:15px;background:#681709;border-radius:10px;float:left}
	.menus a{display:block;width:200px;font-size:25px;}
    .menu{display:none;text-align:center}
    #a{font-size:16px;color:white;background:#681709}
    .titles{border:solid 3px;width:210px;border-radius:15px}
    .panel{color:#681709;border:solid 3px;}
#FirstBtn{font-size:18px;color:red}
.col{color:#681709;border:solid 3px;margin:10px}
.tr{background:#681709;color:white}
.BUT{text-align:center}
#A{background:#681709;color:white;font-size:17px;}
.thumbnail{border:solid 1px;}
#Panel{background:#681709;color:white}
#d{height:35px;}
#font{color:black}
#mes{color:red}
.basic{width:80px}
.main{width:430px;}
#pic{width:auto;height:160px;}
.div{text-align:right}
 </style>
  <body>
  	<nav class="navbar navbar-default">
 			<div class="row navbar-form">
 				<div class="col-xs-3 title">
 					<span id="c">C</span><span id="R">R</span><span id="M">M</span><span id="span">客户关系管理系统</span>
 				</div>
 				<div class="col-xs-6 text-right fonts">
 					
 				</div>
 				<div class="col-xs-3 text-right font">
 					<div id="user">
 					<img src="img/<?php echo $users['img']; ?>" style="width: 20px;height: 20px">
 					在线用户：<?php echo $users['wname']; ?>--<<?php echo $users['rname']; ?>>
 					</div>
 					<div id="users">
 					<a href="First.php" id="FirstBtn">首　页</a>
 					</div>
 					<div id="users">
 					<a href="#" id="logoutBtn" data-toggle="modal">退出系统</a>
 					</div>
 					<div id="users">
 					<a href="#" id="FirstBtn" data-toggle="modal">帮　助</a>
 					</div>
 				</div>
 				
 			</div>
 		</nav>
 	
 	<div class="container">
	 	<div class="row">
		 		<div class="col-xs-12">
	 			<div  id="marginal"></div>
	 			<div class="col-xs-3 titles">
	 			<ul class="sf-menu sf-vertical">
						<li class="current">
							<a href="#" id="a">用户登陆管理</a>
							<ul>
								<li><a href="Alteruse.php" id="a">个人资料信息</a></li>
								<li><a href="Alterinfo.php" id="a">个人信息修改</a></li>
							</ul>
						</li>
						<li><a href="#" id="a">我的客户管理</a>
							<ul>
							<li><a href="success.php"id="a">成功客户列表</a></li>
				   			<li><a href="seekIn.php"id="a">挑入记录列表</a></li>
				   			<li><a href="seekOut.php"id="a">挑出记录列表</a></li>
				   			<li><a href="myClient.php"id="a">我的客户列表</a></li>
				   			<li><a href="publicClient.php"id="a">公共客户列表</a></li>
							</ul>
						</li>
						<li><a href="#" id="a">业务产品管理</a>
							<ul>
								<li><a href="companyProduct.php"id="a">公司产品</a></li>
				   				<li><a href="myTrade.php"id="a">我的交易</a></li>
				   			</ul>
				   		</li>
						<li><a href="#" id="a">全部客户管理</a>
							<ul>
								<li><a href="allClient.php"id="a">全部客户列表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">全体职员管理</a>
							<ul>
								<li><a href="allphpWorker.php"id="a">全体职员列表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">销售客户统计</a>
							<ul>
								<li><a href="#"id="a">全体销售代表成绩表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">销售部门管理</a>
							<ul>
								<li><a href="sell.php"id="a">销售部列表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">系统用户管理</a>
							<ul>
								<li><a href="systemUse.php"id="a">系统用户列表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">角色权限管理</a>
							<ul>
								<li><a href="systemUseRole.php"id="a">系统用户角色列表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">客户跟进管理</a>
							<ul>
								<li><a href="#"id="a">待跟进客户列表</a></li>
				   				<li><a href="myTabb.php"id="a">我的客户跟进列表</a></li>
				   			</ul>
						</li>
					</ul>
	 			</div>
	 			<div class="col-xs-8 main">
	 			 	<?php if(!empty($message)){ ?>
	 			 		<div class="alert alert-warning alert-danger" >
	 			 			<?php echo $message?>
   				  		  <button type="button" class="close" data-dismiss="alert"><span >&times;</span></button>
   				    	</div>
					<?php } ?>
	 				<div class="panel panel-default">
			            <div class="panel-heading">
			              	<h4>添加客户</h4>
			            </div>
		                  <div class="panel-body">
		                    <form action="ProcessClient.php" method="post" class="form-horizontal">
		                    <div id="pic" class="col-xs-4 col-xs-offset-2">
		                    	<img id="imgView" src="img/2.jpeg" width="190" height="150"/>
		                    </div>
		                    <div class="form-group">
		                        <label class="control-label col-sm-4 hidden-xs">头　　像：</label>
		                        <div class="col-sm-8">
					 			<input id="imgInput" name="img" type="file" class="filestyle" data-buttonbefore="true" data-buttontext="浏览" data-icon="false" tabindex="-1" style="position: absolute; clip: rect(0px 0px 0px 0px);">
					 			<div class="bootstrap-filestyle input-group">
					 			<span class="group-span-filestyle input-group-btn" tabindex="0">
					 			<label for="imgInput" class="btn btn-default "><span class="buttonText">浏览</span></label>
					 			</span><input type="text" class="form-control " disabled="disabled">
					 			</div>
		                        </div>
		                    </div>
		                    <div class="form-group">
		                        <label class="control-label col-sm-4 hidden-xs">姓　　名：</label>
		                        <div class="col-sm-8">
		                            <input name="name" class="form-control" type="text"/>
		                        </div>
		                    </div>
		                    <div class="form-group">
		                        <label class="control-label col-sm-4 hidden-xs">年　　龄：</label>
		                        <div class="col-sm-8">
		                            <input name="age" class="form-control" type="number">
		                        </div>
		                    </div>
		                    <div class="form-group">
		                        <label class="control-label col-sm-4 hidden-xs">性　　别：</label>
		                        <div class="col-sm-8">
		                        	<select class="form-control" name="sex">
			                            <option>男</option>
			                            <option>女</option>
		                            </select>
		                        </div>
		                    </div>
		                    <div class="form-group">
		                        <label class="control-label col-sm-4 hidden-xs">联系方式：</label>
		                        <div class="col-sm-8">
		                            <input name="contact" class="form-control" type="number"/>
		                        </div>
		                    </div>
		                    <div class="form-group">
		                        <label class="control-label col-sm-4 hidden-xs">常住住址：</label>
		                        <div class="col-sm-8">
		                            <input name="address"  class="form-control"/>
		                        </div>
		                    </div>
		                    <div class="row">
		                        <div class="col-xs-6 col-xs-offset-6 div">
		                            <button type="submit" class="btn btn-default">添　加</button>
		                          	<a href="allclient.php" class="btn btn-default">上一级</a>
		                          	</div>
		                          </div>
		                   </form>
		          	  	</div>
		        	</div>
	 			</div>
	 		</div>
	 	</div>
 	</div>
 </body>
  <script>
   	$('.dropdown-submenu > a').submenupicker();
   	$('.sf-menu').superfish();
   </script>
</html>